<?php
/*
 * @Description: 
 * @Author: Leequik
 * @Date: 2023-05-11 19:34:44
 * @LastEditTime: 2024-02-02 16:54:39
 * @LastEditors: Leequik
 */

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::resource('/cruds','Home\CrudsController',[
    'except' => ['edit','show','store']
]);


/*
Route::group(['prefix'=>'/cruds'],function(){
    Route::get('/','/home/CrudsController@index');
    Route::get('/create','/home/CrudsController@create');
    Route::put('/{id}','/home/CrudsController@update');
    Route::get('/{id}','/home/CrudsController@destroy');

});
*/

//时间轴数据获取
Route::get('/timeline', 'Home\TimeLineController@index');
Route::post('/timeline/add', 'Home\TimeLineController@save');





/*********************************************************** */
//后台接口

Route::get('/user/list','Backend\AdminController@list');//用户列表信息
Route::post('/user/save', 'Backend\AdminController@save'); //用户信息保存
Route::post('/user/update', 'Backend\AdminController@update'); //用户信息修改
Route::put('/user/status','Backend\AdminController@setStatus');//启用禁用设置以及软删除
Route::get('/user/captchaSrc','Backend\AdminController@captcha');//获取验证码图片
Route::post('/user/login','Backend\AdminController@login');//登陆验证


//Route::get('/role/pluck','Backend\RoleController@role_pluck');//角色id与role_name的关联数据
Route::get('/role/roleArr','Backend\RoleController@getRole');//角色id name数组
Route::get('/role/list','Backend\RoleController@list');//角色列表信息
Route::post('/role/save','Backend\RoleController@save');//保存角色
Route::put('/role/del','Backend\RoleController@del');//删除角色

Route::get('/category/list','Backend\CategoryController@index');//文章列表信息
Route::post('/category/save','Backend\CategoryController@save');//保存文章分类
Route::put('category/level','Backend\CategoryController@setLevel');//分类上下移动
Route::get('category/cateArr','Backend\CategoryController@getCate');//分类id与name的数组


Route::post('/report/uploadfile','Backend\RrportController@uploadFile');//文件上传到指定文件夹
Route::put('/report/delfile','Backend\RrportController@delFile');//删除文件



Route::any('common/imgup','CommonController@imgUpload');//图片上传
